home *** CD-ROM | disk | FTP | other *** search
- global gBigBalloon, gBDropSprite, gOldSpot, gSpotLightFrame, gBalloons, gBalloonsList, gReturnFrame, gUserLevel, gCursorSprite, gSlowMachine, cHotCursor, cGeneralCursor, gHot, gHotMask, gTokens, gTokenSprite, gStartDarts
-
- on fnc startPoint, endPoint, whichStep
- if whichStep < 1 then
- set whichStep to 1
- end if
- return endPoint - ((endPoint - startPoint) / whichStep)
- end
-
- on updateDart whichSprite, whichDart, userH, userV, destinationH, destinationV, whichValue
- set the loc of sprite whichSprite to point(fnc(userH, destinationH, whichValue), fnc(userV, destinationV, whichValue))
- updateStage()
- end
-
- on returnCursor
- set userH to the mouseH
- set userV to the mouseV
- set origLoc to the loc of sprite gCursorSprite
- set newLoc to point(userH, userV)
- slidePiece(gCursorSprite, origLoc, newLoc, 15)
- end
-
- on movePiece whichSprite, whichSprite2, numberOfPieces, snapDistance, spriteOffset1, spriteOffset2, whichSound
- set userH to the mouseH
- set userV to the mouseV
- set offsetH to userH - the locH of sprite whichSprite
- set offsetV to userV - the locV of sprite whichSprite
- set theForeColor to the foreColor of sprite whichSprite
- set activateScript to setActivateScript(whichSprite, whichSprite2)
- do(activateScript)
- set the foreColor of sprite whichSprite2 to theForeColor
- puppetSprite(whichSprite, 1)
- set the locV of sprite whichSprite to -500
- updateStage()
- repeat while the mouseDown
- set userH to the mouseH
- set userV to the mouseV
- set origLoc to the loc of sprite whichSprite2
- set newLoc to point(userH - offsetH, userV - offsetV)
- slidePiece(whichSprite2, origLoc, newLoc, 3)
- end repeat
- playSound(whichSound)
- set gUserLevel to checkRange(gUserLevel, 1, 3)
- set numberOfMatches to 0
- set numberOfPieces to getAt(numberOfPieces, gUserLevel)
- set snapDistance to getAt(snapDistance, gUserLevel)
- set the loc of sprite whichSprite to the loc of sprite whichSprite2
- deactivate([whichSprite2])
- updateStage()
- repeat with x = 1 to numberOfPieces
- set whichSprite to x + spriteOffset1
- if the type of sprite whichSprite > 0 then
- set distanceH to abs(the locH of sprite whichSprite - the locH of sprite (whichSprite + spriteOffset2))
- set distanceV to abs(the locV of sprite whichSprite - the locV of sprite (whichSprite + spriteOffset2))
- if (distanceH = 0) and (distanceV = 0) then
- set numberOfMatches to numberOfMatches + 1
- next repeat
- end if
- if (distanceH <= snapDistance) and (distanceV <= snapDistance) then
- slidePiece(whichSprite, the loc of sprite whichSprite, the loc of sprite (whichSprite + spriteOffset2), 3)
- set numberOfMatches to numberOfMatches + 1
- end if
- end if
- end repeat
- if numberOfMatches >= numberOfPieces then
- if the frame < label("Ma Barker") then
- playSound("Band Win")
- delayFor(30)
- end if
- go(marker(1))
- else
- go(the frame)
- end if
- end
-
- on moveTangram whichSprite
- set numberOfPieces to [4, 4, 7]
- set snapDistance to [20, 15, 10]
- movePiece(whichSprite, 37, numberOfPieces, snapDistance, 28, -16, 0)
- end
-
- on moveBand whichSprite
- set numberOfPieces to [3, 4, 5]
- set snapDistance to [15, 15, 15]
- set newSound to "!" & the name of cast the castNum of sprite whichSprite & " Band"
- movePiece(whichSprite, 23, numberOfPieces, snapDistance, 16, -7, newSound)
- end
-
- on slidePiece whichSprite, origLoc, newLoc, numberOfSteps
- puppetSprite(whichSprite, 1)
- repeat with x = 1 to numberOfSteps
- set the loc of sprite whichSprite to fnc(origLoc, newLoc, x)
- updateStage()
- end repeat
- set the loc of sprite whichSprite to newLoc
- updateStage()
- end
-
- on scrollWaldo userH, userV, distance
- set newH to -1
- set newV to -1
- if userH < 10 then
- set newH to checkRange(the locH of sprite gBDropSprite + distance, 205, 307)
- else
- if userH > 502 then
- set newH to checkRange(the locH of sprite gBDropSprite - distance, 205, 307)
- end if
- end if
- if userV < 10 then
- set newV to checkRange(the locV of sprite gBDropSprite + distance, 98, 286)
- else
- if userV > 374 then
- set newV to checkRange(the locV of sprite gBDropSprite - distance, 98, 286)
- end if
- end if
- if newH > 0 then
- set oldH to the locH of sprite gBDropSprite
- set the locH of sprite gBDropSprite to newH
- repeat with x = 1 to 2
- set offsetH to oldH - the locH of sprite (gBDropSprite + x)
- set the locH of sprite (gBDropSprite + x) to newH - offsetH
- end repeat
- end if
- if newV > 0 then
- set oldV to the locV of sprite gBDropSprite
- set the locV of sprite gBDropSprite to newV
- repeat with x = 1 to 2
- set offsetV to oldV - the locV of sprite (gBDropSprite + x)
- set the locV of sprite (gBDropSprite + x) to newV - offsetV
- end repeat
- end if
- go(the frame)
- end
-
- on gimmeaBalloon whichPos, whichFrame, whichBalloon, now
- set gBigBalloon to 0
- store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- if not listp(gBalloonsList) then
- set gBalloonsList to [0, 0, 0, 0]
- end if
- if whichPos <= count(gBalloonsList) then
- if (getAt(gBalloonsList, whichPos) = 0) or now then
- setAt(gBalloonsList, whichPos, 1)
- set gBalloons to checkRange(gBalloons + 1, 1, 4)
- if whichFrame < 1 then
- set gReturnFrame to the frame
- else
- set gReturnFrame to whichFrame
- end if
- if whichBalloon < 1 then
- setProp(1, 40, "puppet", 1)
- setProp(41, 48, "puppet", 0)
- go("Balloons" & gBalloons)
- else
- go(the frame)
- end if
- end if
- end if
- end
-
- on gimmeaBigBalloon whichPos, whichFrame, now
- if not (the commandDown) then
- set gBigBalloon to whichPos
- store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- if whichFrame < 1 then
- set gReturnFrame to the frame
- else
- set gReturnFrame to whichFrame
- end if
- setProp(1, 45, "puppet", 1)
- setProp(46, 48, "puppet", 0)
- go("big balloon")
- end if
- end
-
- on gimmeaBigBalloon2 whichPos, whichFrame, now
- store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- if not listp(gBalloonsList) then
- set gBalloonsList to [0, 0, 0, 0]
- end if
- if whichPos <= count(gBalloonsList) then
- if (getAt(gBalloonsList, whichPos) = 0) or now then
- if whichFrame < 1 then
- set gReturnFrame to the frame
- else
- set gReturnFrame to whichFrame
- end if
- setProp(1, 45, "puppet", 1)
- setProp(46, 48, "puppet", 0)
- go("big balloon")
- end if
- end if
- end
-
- on returnBalloon
- restore([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- setProp(41, 48, "puppet", 1)
- go(gReturnFrame)
- end
-